import ajax from './ajax'

const BASE_URL = '/api'

// 根据漏洞的CVE编号获取漏洞详情信息
export const reqVulDetails = (vulName) => ajax(`${BASE_URL}/vul_search`, { vul_name: vulName })

// 根据CWE编号获取缺陷详情以及相关漏洞
export const reqWeakness = (cweId) => ajax(`${BASE_URL}/weakness_search`, { cweId })

// 根据产品名称查询相关信息
export const reqProduct = (productName) => ajax(`${BASE_URL}/product_search`, { product_name: productName })

// 使用NER模型标注漏洞描述中的实体
export const reqNerForVulDescription = (description) => ajax(`${BASE_URL}/nlp/ner`, { vul_description: description })
